/* 合并后的统一样式 */
:root {
    --primary-color: #ff8b94;
    --secondary-color: #dcedc1;
    --text-color: #555;
    --nav-bg: linear-gradient(135deg, #a8e6cf, #dcedc1);
    --btn-bg: linear-gradient(to right, #ff8b94, #ffaaa5);
}

/* 基础样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    background-color: #f9f9f9;
    background-image: linear-gradient(to bottom, #f9f9f9, #f0f7f4);
}

/* 导航栏样式 */
.navbar {
    background: var(--nav-bg);
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.nav-item {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
}

/* 模板缩略图样式 */
.template-thumbnail {
    width: 200px;
    height: 150px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--secondary-color);
    margin: 10px;
    padding: 10px;
    text-align: center;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

.template-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.template-thumbnail img {
    max-width: 100%;
    max-height: 120px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    object-fit: contain;
}

/* 表单相关样式 */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.8);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 139, 148, 0.2);
}

textarea {
    height: 150px;
}

button {
    background: var(--btn-bg);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    width: auto;
    margin: 0 auto;
    display: block;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(255, 139, 148, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 139, 148, 0.4);
}

/* 移动端适配 */
@media (max-width: 600px) {
    .navbar {
        padding: 15px 20px;
        margin: 0 -20px 30px;
        width: 100vw;
        box-sizing: border-box;
    }

    .nav-container {
        width: 100%;
        max-width: none;
        flex-direction: column;
        align-items: center;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .template-thumbnail {
        width: 90%;
        height: 220px;
        margin: 15px auto;
    }

    .template-thumbnail img {
        max-height: 180px;
    }

    .template-container {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 600px) {
    /* 添加视口单位 */
    .nav-item {
        margin-bottom: 1vw;
        padding: 2vw;
    }

    /* 确保按钮可点击区域足够大 */
    button {
        min-width: 40vw;
        padding: 3vw;
    }
}


/* Markdown按钮样式 */
@media (max-width: 600px) {
    .form-group button[type="button"] {
        padding: 2vw;
        min-width: 10vw;
        font-size: 3.5vw;
    }
}
.form-group button[type="button"] {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: none;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group button[type="button"]:hover {
    background: #e9e9e9;
    border-color: #ccc;
    transform: none;
    box-shadow: none;
    color: #333;
}
.form-group button[type="button"].active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 预览区域样式 */
.markdown-preview {
    border: 1px solid var(--secondary-color);
    background: rgba(255,255,255,0.95);
    color: var(--text-color);
    /* 保持原有其他样式 */
}

#markdown-preview pre {
    background: var(--secondary-color);
    padding: 10px;
    border-radius: 4px;
}


/* Footer样式 */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    color: #666;
    font-size: 14px;
    border-top: 1px solid #dcedc1;
}


/* 模板标题样式 */
.form-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.article-section h2 {
    text-align: center;
    margin: 30px 0 20px;
}

